package com.spyx.common.config;


import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration  //标记当前类是配置类
public class MQConfig {

    @Bean  //设置mq的消息转换器为JSON格式，默认是字符串
    public MessageConverter messageConverter(){
        return new Jackson2JsonMessageConverter();
    }
}
